VT-d: size qinval queue dynamically
authorJan Beulich <jbeulich@suse.com>
Tue, 8 Jun 2021 17:05:25 +0000 (18:05 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 8 Jun 2021 17:36:03 +0000 (18:36 +0100)
commit2665d9785e748bf9cd87ec5783099e644ce2bac2
treefc66078572b5b04a0877bb9b5d43cddb2efe402f
parent7053c8ea5dc88e0a3b6579d3bb61a242fcd5c499
VT-d: size qinval queue dynamically

With the present synchronous model, we need two slots for every
operation (the operation itself and a wait descriptor).  There can be
one such pair of requests pending per CPU. To ensure that under all
normal circumstances a slot is always available when one is requested,
size the queue ring according to the number of present CPUs.

This is part of XSA-373 / CVE-2021-28692.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Paul Durrant <paul@xen.org>
(cherry picked from commit cbfa62bb140c8f10a0ae96db3ce06e22b3b9d302)
xen/drivers/passthrough/vtd/iommu.h
xen/drivers/passthrough/vtd/qinval.c